package my.jbf.firstGame.BITMAP;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;

import my.jbf.firstGame.GAMEDATA.SharedPreferenceManager;
import my.jbf.firstGame.MainActivity;

public class SmallMap {
    private Bitmap mBitmap;
    private Paint mPaint;
    private Canvas mCanvas;
    private final SharedPreferenceManager mSPM;
    public SmallMap()
    {
        mSPM= MainActivity.mSPM;
        init();
    }
    private void init()
    {
        mBitmap=Bitmap.createBitmap(mSPM.getSmallMapSize() , mSPM.getSmallMapSize(), Bitmap.Config.ARGB_8888);
        mCanvas=new Canvas(mBitmap);
        mPaint=new Paint();
        //mPaint.setColor(mSPM.getSmallMapColor());
        mPaint.setColor(Color.BLACK);
        mPaint.setStyle(Paint.Style.STROKE);
    }
    public Bitmap getBitmap()
    {
        reDraw();
        return mBitmap;
    }
    private void reDraw()
    {
        mBitmap.eraseColor(Color.argb(0,0,0,0));
        mCanvas.drawRect(0,0,mSPM.getSmallMapSize()-1,mSPM.getSmallMapSize()-1,mPaint);
    }
}
